1. Technical Field
This application relates to computer storage devices, and more particularly to communication between storage devices.
2. Description of Related Art
Host processor systems may store and retrieve data using a storage device containing a plurality of host interface units (host adapters), disk drives, and disk interface units (disk adapters). Such storage devices are provided, for example, by EMC Corporation of Hopkinton, Mass. and disclosed in U.S. Pat. No. 5,206,939 to Yanai et al., U.S. Pat. No. 5,778,394 to Galtzur et al., U.S. Pat. No. 5,845,147 to Vishlitzky et al., and U.S. Pat. No. 5,857,208 to Ofek. The host systems access the storage device through a plurality of channels provided therewith. Host systems provide data and access control information through the channels to the storage device and the storage device provides data to the host systems also through the channels. The host systems do not address the disk drives of the storage device directly, but rather, access what appears to the host systems as a plurality of logical disk units. The logical disk units may or may nor correspond to the actual disk drives. Allowing multiple host systems to access the single storage device unit allows the host systems to share data stored therein.
In some instances, it may be desirable to copy data from one storage device to another. For example, if a host writes data to a first storage device, it may be desirable to copy that data to a second storage device provided in a different location so that if a disaster occurs that renders the first storage device inoperable, the host (or another host) may resume operation using the data of the second storage device. Such a capability is provided, for example, by the Remote Data Facility (RDF) product provided by EMC Corporation of Hopkinton, Massachusetts. With RDF, a user may denote a first storage device as a master storage device and a second storage device as a slave storage device. Other incarnations of RDF may be provide a peer to peer relationship between the local and remote storage devices. The interacts directly with the local storage device, but any data changes made to the local storage device are automatically provided to a remote storage device using RDF. The local and remote storage devices may be connected by a data link, such as an ESCON link. The RDF functionality may be facilitated with an RDF adapter (RA) provided at each of the storage devices.
In some instances, it may be desirable for the host to be able to verify that the data stored on the remote storage device is consistent with the data stored on the local storage device. However, doing so may be difficult if there may be no convenient mechanism for the host to efficiently examine data on the remote storage device to compare the local data with the data stored on the remote storage device. Thus, it would be useful to have a mechanism for conveniently obtaining the data from the remote storage device in order to perform the comparison.
According to the present invention, providing data from a volume of a remote storage device coupled to a local storage device that is coupled to a host, includes providing a command to the remote storage device to request the data, if the data is stored in a cache portion of the remote storage device, the remote storage device providing the data, and if the data is not stored in the cache portion of the remote storage device, the remote storage device causing the data to be fetched from the volume and returning one of: a disconnect or an indicator that the data was not found. Causing the data to be fetched from the volume may include providing a request for the data on a queue that is serviced by a disk adapter corresponding to the volume. The data may be provided from the remote storage device to the local storage device. The local storage device may provide the data to the host. Providing a command to the remote storage device may include transmitting a command from the local storage device to the remote storage device. Prior to the local storage device providing the command to the remote storage device, the host may provide the command to the local storage device. Causing the data to be fetched from the volume may include creating a separate wait task that waits for the data to be fetched from the volume. The separate wait task may be created only if there is not already another wait task waiting for the same data. The wait task may post an error if the data is not fetched after a predetermined amount of time, such as four seconds. An error may be posted if the data is not fetched after a predetermined amount of time, such as eight seconds. After the data has been fetched from the volume, the remote storage device may provide a reconnect command followed by the data. In response to the data being in the cache portion of the remote storage device, the cache portion may be locked prior to transferring data therefrom. Following locking the cache portion, the data may be retested to determine if the data is still stored in the cache portion and, in response to retesting indicating that the data is not in the cache portion, the remote storage device may unlock the cache portion and then cause the data to be fetched from the volume and return one of: a disconnect or an indicator that the data was not found. Following transferring the data from the cache portion, the cache portion may be unlocked.
According further to the present invention, retrieving data includes providing a command to a remote storage device containing the data and receiving one of: the data or an indicator that the data is not available, where, following receipt of the indicator, data becomes available at the remote storage device after an amount of time that corresponds to retrieving the data from a disk of the storage device. The indicator may include a disconnect or a data_not_found message. The remote storage device may retrieve data by providing a request for the data on a queue that is serviced by a disk adapter corresponding to the disk. Providing a command to a remote storage device may include providing the command to a local storage device and the local storage device providing the command to the remote storage device. Retrieving data may also include, in response to the data not being available in cache memory of the remote storage device, causing the data to be fetched from the disk. Causing the data to be fetched from the disk may include providing a request for the data on a queue that is serviced by a disk adapter corresponding to the disk. Causing the data to be fetched from the disk may include creating a separate wait task that waits for the data to be fetched from the disk. The separate wait task may be created only if there is not already another wait task waiting for the same data. The wait task may post an error if the data is not fetched after a predetermined amount of time, such as four seconds. An error may be posted if the data is not fetched after a predetermined amount of time, such as eight seconds. Retrieving data may also include, after the data has been fetched from the disk, the remote storage device providing a reconnect command followed by the data. Retrieving data may also include, in response to the data being in the cache portion of the remote storage device, locking the cache portion prior to transferring data therefrom. Retrieving data may also include, following locking the cache portion, retesting to determine if the data is still stored in the cache portion and, in response to retesting indicating that the data is not in the cache portion, the remote storage device unlocking the cache portion and then causing the data to be fetched from the disk and returning one of: a disconnect or an indicator that the data was not found. Retrieving data may also include following transferring the data from the cache portion, unlocking the cache portion.
According further to the present invention, computer software that provides data from a volume of a remote storage device, includes executable code that receives a command sent to the remote storage device to request the data, executable code that provides the data if the data is stored in a cache portion of the remote storage device, and executable code that causes the data to be fetched from the volume and returns one of: a disconnect or an indicator that the data was not found if the data is not stored in the cache portion of the remote storage device. Executable code that causes the data to be fetched from the volume may include executable code that provides a request for the data on a queue that is serviced by a disk adapter corresponding to the volume. Executable code that causes the data to be fetched from the volume may include executable code that creates a separate wait task that waits for the data to be fetched from the volume. The separate wait task may be created only if there is not already another wait task waiting for the same data. The wait task may post an error if the data is not fetched after a predetermined amount of time, such as four seconds. An error may be posted if the data is not fetched after a predetermined amount of time, such as eight seconds. The computer software may also include executable code that provides a reconnect command followed by the data after the data has been fetched from the volume. The computer software may also include executable code that locks the cache portion prior to transferring data therefrom in response to the data being in the cache portion of the remote storage device. The computer software may also include executable code that retests to determine if the data is still stored in the cache portion following locking the cache portion and executable code that unlocks the cache portion, causes the data to be fetched from the volume, and returns one of: a disconnect or an indicator that the data was not found in response to retesting indicating that the data is not in the cache portion. The computer software may also include executable code that unlocks the cache portion following transferring the data from the cache portion.
According further to the present invention, a remote storage device includes a disk, a cache memory in communication with the disk, means for receiving requests for data stored on the disk, means for providing requested data if the requested data is also stored in the cache memory, and means for causing the data to be fetched from the disk and providing one of: a disconnect or an indicator that the data is not found if the requested data is not stored in the cache memory. Means for causing the data to be fetched from the disk may include means for providing a request for the data on a queue that is serviced by a disk adapter corresponding to the disk. The data may be provided from the remote storage device to a local storage device. The data may be provided to a host. Means for causing the data to be fetched from the disk may includes means for creating a separate wait task that waits for the data to be fetched from the disk. The separate wait task may be created only if there is not already another wait task waiting for the same data. The wait task may post an error if the data is not fetched after a predetermined amount of time, such as four seconds. An error may be posted if the data is not fetched after a predetermined amount of time, such as eight seconds. The remote storage device may also include means for providing a reconnect command followed by the data after the data has been fetched from the disk. The remote storage device may also include means for locking the cache memory prior to transferring data therefrom in response to the data being in the cache memory. The remote storage device may also include means for retesting to determine if the data is still stored in the cache memory following locking the cache memory and means for unlocking the cache memory and then causing the data to be fetched from the disk and returning one of: a disconnect or an indicator that the data was not found in response to retesting indicating that the data is not in the cache memory. The remote storage device may also include means for unlocking the cache memory following transferring the data from the cache memory.